


public class Oracle {

	public String[] inputline;	

	
	public Oracle(){
		
	}
	
	
	public void lancerOracle(String inputFile, String outputFile){ 
	
		
		try{
		LireEcrire lectureEcriture= new LireEcrire(inputFile,outputFile);		
	    String strLineIn;
	    String strLineOut=null;
	    int lineCount = 0;
	    int decod;
	    String[] hexa=null;
	    
	    while ((strLineIn = lectureEcriture.lire()) != null){
	    	lineCount++;
	    	
	    	inputline=strLineIn.split(" ");
	    	hexa = new String[3];
	    	hexa[0] = inputline[0];
	    	if(hexa[0].compareTo("F0")!=0){
	    	for(int i =1;i!=inputline.length;i++){
	    			decod=Integer.decode(inputline[i]);
	    			hexa[i] = Integer.toHexString(decod);
	
	    		}
	    	if(hexa[0].compareTo("F1")==0)
	    		strLineOut = "30"+lineCount+" "+hexa[1];
	    	else if(hexa[0].compareTo("F2")==0)	
	    		strLineOut = "30"+lineCount+" "+hexa[1]+hexa[2];
	    	else if(hexa[0].compareTo("F3")==0)
	    		strLineOut = "30"+lineCount+" "+hexa[1]+" "+hexa[2];
	    	}
	    	else{
	    		strLineOut = "30"+lineCount+" "+inputline[1];
	    	}
	    	
	    	
	    	strLineOut=strLineOut.toUpperCase();
	    	
	    	lectureEcriture.ecrire(strLineOut);
	    	
	    	
	    	
	    	
	    }
	    
	    lectureEcriture.finir();
		}
		catch (Exception e){//Catch exception if any
		      System.err.println("Error: " + e.getMessage());
		    }
		
	}
	
	
	
}





